#ifndef _RKNN_ZERO_COPY_DEMO_POSTPROCESS_H_
#define _RKNN_ZERO_COPY_DEMO_POSTPROCESS_H_

#include "opencv2/core/types.hpp"
#include "opencv2/imgproc.hpp"
#include "nle/nle_file.h"
#include <vector>
#include <string>
#include <net.h>

#define OBJ_NAME_MAX_SIZE 16
#define OBJ_NUMB_MAX_SIZE 64
#define OBJ_CLASS_NUM     80
#define NMS_THRESH        0.45
#define BOX_THRESH        0.25
#define PROP_BOX_SIZE     (5+OBJ_CLASS_NUM)


struct FaceObject_T{
    cv::Rect_<float> rect;
    cv::Point2f landmark[5];
    float prob;
};

//定义yolov8_object类
struct _YOLO_OBJECT {
  cv::Rect_<float > rect;
    int label;
    float prob;
};

typedef struct _BOX_RECT
{
    int left;
    int right;
    int top;
    int bottom;
} BOX_RECT;

typedef struct __detect_result_t
{
    char name[OBJ_NAME_MAX_SIZE];
    BOX_RECT box;
    float prop;
} detect_result_t;




void nms_sorted_bboxes(const std::vector<_YOLO_OBJECT> &objects, std::vector<int> &picked, float nms_threshold,
                       bool agnostic);
void qsort_descent_inplace(std::vector<_YOLO_OBJECT> &objects);
void generate_proposals(const ncnn::Mat &pred, const std::vector<int> &strides, const ncnn::Mat &in_pad,
                        float prob_threshold, std::vector<_YOLO_OBJECT> &objects);


#endif //_RKNN_ZERO_COPY_DEMO_POSTPROCESS_H_
